﻿

Namespace YahooManaged.Geo.PlaceFinder


    Public Class PlaceFinderData
        Implements IPlace

        Public ReadOnly Property Address As String Implements IPlace.Address
            Get
                Dim sb As New Text.StringBuilder
                If Me.PoiAoiName <> String.Empty Then sb.AppendLine(Me.PoiAoiName)
                If Me.DefaultAddress IsNot Nothing Then
                    sb.AppendLine(Me.DefaultAddress.ToString)
                End If

                Return sb.ToString
            End Get
        End Property
        Public Property Quality As AddressQualitiy
        Public Property Position As Coordinates Implements IPlace.Position
        Public Property PositionOffSet As CoordinatesOffSet
        Public Property Radius As Integer Implements IPlace.Radius
        Public Property BoundingBox As CoordinatesRectangle Implements IPlace.BoundingBox
        Public Property PoiAoiName As String
        Public Property ExtendedAddress As ExtendedAddress
        Public Property DefaultAddress As Address

        Public Property TimeZone As String = String.Empty
        Public Property TelephoneAreaCode As String = String.Empty
        Public Property UniqueZipCode As String = String.Empty Implements IPlace.ZipCode
        Public Property Hash As String = String.Empty
        Public Property WOEID As Long = 0 Implements IPlace.WOEID
        Public Property WOEType As PlaceType Implements IPlace.WOEType
    End Class



    Public Class Address

        Public Property StreetAddressOrIntersection As String = String.Empty
        Public Property CityOrStateOrZipCode As String = String.Empty
        Public Property PostalCode As String = String.Empty
        Public Property Country As String = String.Empty

        Public Overrides Function ToString() As String
            Dim add As String = String.Empty
            If Me.StreetAddressOrIntersection <> String.Empty Then add = Me.StreetAddressOrIntersection & vbCrLf
            If Me.PostalCode <> String.Empty Then add &= Me.PostalCode
            If Me.CityOrStateOrZipCode <> String.Empty Then add &= Me.CityOrStateOrZipCode
            If Me.Country <> String.Empty Then add &= vbCrLf & Me.Country
            Return add
        End Function
    End Class

    Public Class ExtendedAddress

        ''' <summary>
        ''' House number
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property House As String = String.Empty
        Public Property Street As IStreetDescription = Nothing
        ''' <summary>
        ''' Unit type such as Apartment(Apt) or Suite(Ste)
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property UnitType As String = String.Empty
        ''' <summary>
        ''' Unit decription i.e. appartment number
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Unit As String = String.Empty
        Public Property CrossStreets As String = String.Empty
        Public Property CrossStreet As IStreetDescription = Nothing
        Public Property PostalCode As String = String.Empty
        Public Property Neighborhoods As String()
        Public Property City As String = String.Empty
        Public Property County As String = String.Empty
        Public Property State As String = String.Empty
        Public Property Country As String = String.Empty

        Public Property CountyCode As String = String.Empty
        Public Property StateCode As String = String.Empty
        Public Property CountryCode As String = String.Empty

    End Class

    Public Interface IStreetDescription
        Property FullName As String
    End Interface

    Public Class SimpleStreetDescription
        Implements IStreetDescription
        Public Property FullName As String = String.Empty Implements IStreetDescription.FullName
        Public Overrides Function ToString() As String
            Return Me.FullName
        End Function
    End Class

    Public Class DetailedStreetDescription
        Implements IStreetDescription
        Public Property FullName As String = String.Empty Implements IStreetDescription.FullName
        Public Property PrefixDirectional As String = String.Empty
        Public Property PrefixType As String = String.Empty
        Public Property Body As String = String.Empty
        Public Property Suffix As String = String.Empty
        Public Property SuffixDirectional As String = String.Empty
        Public Overrides Function ToString() As String
            Return Me.FullName
        End Function
    End Class

End Namespace